package com.ldz.eb.contoller;

import com.ldz.eb.module.EbProduct;
import com.ldz.eb.service.ProductService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("product")
public class ProductController {
    @Resource private ProductService productService;
    @RequestMapping("/detail")
    public String detail(Model model, int pid){
        System.out.println("进入productController的detail方法"+pid);
        EbProduct proDetail= productService.detail(pid);
        model.addAttribute("proDetail",proDetail);
        return "product-view";
    }
}
